﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OOLib
{
   /// <summary>
   /// Describes the link for a text section.
   /// </summary>
   /// <remarks>
   /// If the URL is an empty string, then the section is not linked.
   /// The bookmark of the URL (after the "#") is the name of a bookmark or a section name in the linked document. 
   /// If a bookmark or section with this name exists in the document, then only this part is linked into the given text section.
   /// FilterName is the internal name of the document filter. To use this struct, it is not necessary to set FilterName. 
   /// It will be automatically assigned.
   /// </remarks>
   public class SectionFileLink : ComObjectWrapper
   {
      #region Constructors

      /// <summary>
      /// Constructor
      /// </summary>
      /// <remarks>
      /// After using this constructor, the ComObj must be set manually!
      /// </remarks>
      public SectionFileLink() :
         base()
      { }

      /// <summary>
      /// Constructor
      /// </summary>
      /// <param name="comObject">COM object</param>
      public SectionFileLink(object comObject) :
         base(comObject)
      { }

      #endregion

      /// <summary>
      /// Gets or sets the URL of the linked file.
      /// </summary>
      public string FileURL
      {
         get
         {
            CheckDisposed();
            return (string)GetProperty("FileURL");
         }
         set
         {
            CheckDisposed();
            SetProperty("FileURL", value);
         }
      }

      /// <summary>
      /// Gets or sets the name of the file filter that is used to load the linked file.
      /// </summary>
      public string FilterName
      {
         get
         {
            CheckDisposed();
            return (string)GetProperty("FilterName");
         }
         set
         {
            CheckDisposed();
            SetProperty("FilterName", value);
         }
      }
   }
}
